package com.lego.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lego.bean.Seller;
import com.lego.service.SellerService;
import com.lego.service.impl.SellerServiceImpl;

@WebServlet("/checkSellerName.do")
public class CheckSellerNameServlet extends HttpServlet {
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		SellerService ss = new SellerServiceImpl();
		String brandName = request.getParameter("brandName");
		//查询是否是改品牌名
		Seller seller = ss.selectBySellerName(brandName);
		String str = "";
		if(seller==null) {
			str = "没有查询到该商家";
		}else {
			str = "正确";
		}
		response.setContentType("text/html;charset=UTF-8");
		response.getWriter().write(str);
	}

}
